package org.example.entity;

import java.sql.Timestamp;
import java.util.List;

public class Review {
    private int id;
    private int contentId;
    private String contentType;
    private int userId;
    private String username;
    private int rating;
    private String content;
    private boolean isAnonymous;
    private String ipAddress;
    private Timestamp createTime;
    private Timestamp updateTime;
    private List<Reply> replies;

    // 无参构造器
    public Review() {
    }

    // 带参构造器（根据需要添加）
    public Review(int contentId, String contentType, int userId, String username,
                  int rating, String content, boolean isAnonymous, String ipAddress) {
        this.contentId = contentId;
        this.contentType = contentType;
        this.userId = userId;
        this.username = username;
        this.rating = rating;
        this.content = content;
        this.isAnonymous = isAnonymous;
        this.ipAddress = ipAddress;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getContentId() {
        return contentId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getRating() {
        return rating;
    }

    public void setRating(int rating) {
        this.rating = rating;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean getIsAnonymous() {
        return isAnonymous;
    }

    public void setIsAnonymous(boolean isAnonymous) {
        this.isAnonymous = isAnonymous;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public List<Reply> getReplies() {
        return replies;
    }

    public void setReplies(List<Reply> replies) {
        this.replies = replies;
    }
    @Override
    public String toString() {
        return "Review{" +
                "id=" + id +
                ", contentId=" + contentId +
                ", contentType='" + contentType + '\'' +
                ", userId=" + userId +
                ", username='" + username + '\'' +
                ", rating=" + rating +
                ", content='" + content + '\'' +
                ", isAnonymous=" + isAnonymous +
                ", ipAddress='" + ipAddress + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}